package com.csxy.six;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
public class AuthApplication implements CommandLineRunner { // 实现 CommandLineRunner 接口
    @Value("${file.upload-dir}")
    private String uploadDir; // 非静态变量
    public static void main(String[] args) {
        SpringApplication.run(AuthApplication.class, args);
    }
    @Override
    public void run(String... args) throws Exception {
        // 在应用启动后打印上传目录
        System.out.println("上传目录配置值: " + uploadDir);
        System.out.println("绝对路径: " + new java.io.File(uploadDir).getAbsolutePath());
    }
}